package com.cloud.mall.pms.service;

import com.cloud.mall.api.CommonPage;
import com.cloud.mall.base.BaseResponse;
import com.cloud.mall.pms.dto.PmsProductAttributeParam;
import com.cloud.mall.pms.dto.PmsProductCategoryParam;
import com.cloud.mall.pms.dto.PmsProductCategoryWithChildrenItem;
import com.cloud.mall.pms.dto.ProductAttrInfo;
import com.cloud.mall.pms.out.PmsProductAttributeOut;
import com.cloud.mall.pms.out.PmsProductCategoryOut;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@Api(tags = "商品分类管理")
@RequestMapping("/productCategory")
public interface PmsProductCategoryService {

    @ApiOperation("添加产品分类")
    @PostMapping("/create")
    BaseResponse create(@RequestBody PmsProductCategoryParam productCategoryParam);

    @ApiOperation("修改商品分类")
    @PostMapping("/update/{id}")
    BaseResponse update(@PathVariable("id") Long id, @RequestBody PmsProductCategoryParam productCategoryParam);

    @ApiOperation("删除商品分类")
    @PostMapping("/delete/{id}")
    BaseResponse delete(@PathVariable("id") Long id);

    @ApiOperation(value = "根据id获取商品分类")
    @GetMapping("/{id")
    BaseResponse<PmsProductCategoryOut> getItem(@PathVariable("id") Long id);

    @ApiOperation("分页查询商品分类")
    @GetMapping("/list/{parentId}")
    BaseResponse<CommonPage<PmsProductCategoryOut>> getList(@PathVariable Long parentId,
                                                            @RequestParam(value = "pageSize", defaultValue = "5") Integer pageSize,
                                                            @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum);

    @ApiOperation("修改导航栏显示状态")
    @PostMapping("/update/navStatus")
    BaseResponse updateNavStatus(@RequestParam("ids") List<Long> ids, @RequestParam("navStatus") Integer navStatus);

    @ApiOperation("修改显示状态")
    @PostMapping("/update/showStatus")
    BaseResponse updateShowStatus(@RequestParam("ids") List<Long> ids, @RequestParam("showStatus") Integer showStatus);

    @ApiOperation("查询所有一级分类及子分类")
    @GetMapping("/list/withChildren")
    BaseResponse<List<PmsProductCategoryWithChildrenItem>> listWithChildren();

}
